<?php echo $form->errorSummary($model); ?>

<div class="row">
	<?php echo $form->labelEx($model,'name'); ?>
	<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>100)); ?>
	<?php echo $form->error($model,'name'); ?>
</div>

<div class="row">
	<?php echo $form->labelEx($model,'url'); ?>
	<?php echo $form->textField($model,'url',array('size'=>60,'maxlength'=>100)); ?>
	<?php echo $form->error($model,'url'); ?>
</div>

<div class="row">
    <?php echo $form->labelEx($model,'site_id'); ?>
    <?php if ($model->id):?>
        <label style="width: auto;"><?php echo $model->site->name;?></label>
    <?php else:?>
        <?php echo $form->dropDownList($model,'site_id', $model->siteOptions, array('prompt'=>'---select site---', 'class'=>'site-options')); ?>
        <?php echo CHtml::link('Create Site', array('/Cms/admin/site/create')); ?>
        <?php echo $form->error($model,'site_id'); ?>
    <?php endif;?>
</div>

<?php if ($model->isNewRecord):?>
<div class="row">
    <?php echo CHtml::label('Active pages same workflow','same_workflow'); ?>
    <?php echo CHtml::dropDownList('same_workflow', '', $workflows, array('prompt'=>'---Select---')) ?>
</div>
<?php else:?>
<div class="row">
    <?php echo $form->labelEx($model,'creation_datetime'); ?>
    <?php echo Yii::app()->getDateFormatter()->formatDateTime(strtotime($model->creation_datetime)); ?>
</div>

<div class="row">
    <?php echo $form->labelEx($model,'last_update'); ?>
    <?php echo Yii::app()->getDateFormatter()->formatDateTime(strtotime($model->last_update)); ?>
</div>

<div class="row">
    <?php echo $form->labelEx($model,'type'); ?>
    <?php echo $model->typeText; ?>
    <?php if ($model->type == 2):?>
    <p class="hint">This is the final workflow. Active pages in this workflow are visible to public viewers</p>
    <?php elseif ($model->type == 1):?>
    <p class="hint"> This is the initial workflow. New page will be added to this workflow automatically</p>
    <?php endif;?>
</div>
<?php endif;?>